<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>插槽练习</title>
    <link rel="stylesheet" href="../lib/bulma.min.css">
</head>
<body>
    <div id="app">
        <todo-header>
            <h1 class="title" slot="title">主标题：2.6.0以前的写法</h1>
            <template #subtitle>
            <h2 class="subtitle">副标题：2.6.0以后推荐的写法，v-slot可简写为#哦，只能放在组件或者template标签中</h2>
            </template>
        </todo-header>
    </div>

    <script src="../lib/vue.js"></script>
    <script>
    //定义组件TodoHeader
    const todoHeaderOptions={
        template:`
          <section class="hero is-primary">
            <div class="hero-body">
              <slot name="title">
                 <p class="title"
                   待办事项列表
                </p>
              </slot>
              <slot name="subtitle">
                <p class="subtitle">
                  今日事，今日毕！
                </p>
              </slot>
            </div>
          </section>
        `
    }
    
    Vue.component('todo-header',todoHeaderOptions)

    const app=new Vue({
        el:'#app',
    })
    
    
    </script>
</body>
</html>